<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "call_centerhistory".
 *
 * @property int $id
 * @property string $post_code 邮政编码
 * @property string $sick_id
 * @property int $memberclassify_id 客户类型
 * @property int $vip_type vip类型
 * @property int $productclassify_id 咨询产品id
 * @property string $like 爱好
 * @property int $parent_id
 * @property string $member_name 客户名
 * @property int $sex 性别
 * @property string $medicine_name 现在用药
 * @property string $sick_name 手动输入病症
 * @property string $home_phone 家庭电话
 * @property string $mobile 手机号码
 * @property string $other_phone 其他电话（家人朋友等）
 * @property string $profession 客户职业
 * @property string $work_phone 工作电话
 * @property string $years 病领
 * @property string $visit_result 回访结果
 * @property int $visitemployee_id 回访者id
 * @property int $nextvisit_time 下次回访时间
 * @property string $pro_name 省
 * @property string $city_name 市名
 * @property string $locate_name 位置
 * @property string $detail_address 详细地址
 * @property int $vip_card 会员卡号
 * @property int $membertype_id 来电类型
 * @property int $totalbuymoney 消费总金额
 * @property int $lastemployee_id 最后联系员工id
 * @property int $owneremployee_id 拥有者id
 * @property int $lastdate_time 最后联系时间
 * @property int $lastseat_number 坐席号
 * @property string $lastseat_ip 坐席ip
 * @property string $memo 备注
 * @property string $buy_address 购买地址
 * @property int $buy_times 购买次数
 * @property int $buy_date 购买日期
 * @property int $returncard_date 退货日期
 * @property string $buy_product 购买的产品
 * @property string $age 年龄
 * @property int $add_date 添加时间
 * @property int $integral 积分
 * @property int $grade_id 等级
 * @property int $mem_type 客户质量
 * @property int $income 收入
 * @property int $member_owner 客户拥有者
 * @property string $identity_card 身份证号
 * @property string $email 邮箱
 * @property int $total_integral 总积分
 * @property int $mem_source 客户来源：电视导购、报纸等
 * @property int $dispatchemp_id 上次分配人id
 * @property string $education 教育
 * @property string $examine 检查情况
 * @property string $wechat 微信号
 * @property int $create_time 创建时间
 */
class CallCenterhistory extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'call_centerhistory';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['memberclassify_id', 'vip_type', 'productclassify_id', 'parent_id', 'sex', 'visitemployee_id', 'nextvisit_time', 'vip_card', 'membertype_id', 'totalbuymoney', 'lastemployee_id', 'owneremployee_id', 'lastdate_time', 'lastseat_number', 'buy_times', 'buy_date', 'returncard_date', 'add_date', 'integral', 'grade_id', 'mem_type', 'income', 'member_owner', 'total_integral', 'mem_source', 'dispatchemp_id', 'create_time'], 'integer'],
            [['post_code'], 'string', 'max' => 10],
            [['sick_id', 'medicine_name', 'sick_name'], 'string', 'max' => 100],
            [['like', 'years', 'visit_result', 'locate_name'], 'string', 'max' => 60],
            [['member_name', 'wechat'], 'string', 'max' => 30],
            [['home_phone', 'mobile', 'other_phone', 'work_phone', 'identity_card'], 'string', 'max' => 20],
            [['profession', 'pro_name', 'city_name', 'email', 'education'], 'string', 'max' => 50],
            [['detail_address'], 'string', 'max' => 200],
            [['audio'], 'string', 'max' => 100],
            [['lastseat_ip'], 'string', 'max' => 64],
            [['memo', 'buy_product', 'examine'], 'string', 'max' => 255],
            [['buy_address'], 'string', 'max' => 150],
            [['age'], 'string', 'max' => 11],
            [['create_time'],'default','value'=>time()],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'post_code' => 'Post Code',
            'sick_id' => 'Sick ID',
            'memberclassify_id' => 'Memberclassify ID',
            'vip_type' => 'Vip Type',
            'productclassify_id' => 'Productclassify ID',
            'like' => 'Like',
            'parent_id' => 'Parent ID',
            'member_name' => 'Member Name',
            'sex' => 'Sex',
            'medicine_name' => 'Medicine Name',
            'sick_name' => 'Sick Name',
            'home_phone' => 'Home Phone',
            'mobile' => 'Mobile',
            'other_phone' => 'Other Phone',
            'profession' => 'Profession',
            'work_phone' => 'Work Phone',
            'years' => 'Years',
            'visit_result' => 'Visit Result',
            'visitemployee_id' => 'Visitemployee ID',
            'nextvisit_time' => 'Nextvisit Time',
            'pro_name' => 'Pro Name',
            'city_name' => 'City Name',
            'locate_name' => 'Locate Name',
            'detail_address' => 'Detail Address',
            'vip_card' => 'Vip Card',
            'membertype_id' => 'Membertype ID',
            'totalbuymoney' => 'Totalbuymoney',
            'lastemployee_id' => 'Lastemployee ID',
            'owneremployee_id' => 'Owneremployee ID',
            'lastdate_time' => 'Lastdate Time',
            'lastseat_number' => 'Lastseat Number',
            'lastseat_ip' => 'Lastseat Ip',
            'memo' => 'Memo',
            'buy_address' => 'Buy Address',
            'buy_times' => 'Buy Times',
            'buy_date' => 'Buy Date',
            'returncard_date' => 'Returncard Date',
            'buy_product' => 'Buy Product',
            'age' => 'Age',
            'add_date' => 'Add Date',
            'integral' => 'Integral',
            'grade_id' => 'Grade ID',
            'mem_type' => 'Mem Type',
            'income' => 'Income',
            'member_owner' => 'Member Owner',
            'identity_card' => 'Identity Card',
            'email' => 'Email',
            'total_integral' => 'Total Integral',
            'mem_source' => 'Mem Source',
            'dispatchemp_id' => 'Dispatchemp ID',
            'education' => 'Education',
            'examine' => 'Examine',
            'wechat' => 'Wechat',
            'create_time' => 'Create Time',
        ];
    }
}
